.class public Lcom/waiqin365/lightapp/store/b/a/d;
.super Lcom/waiqin365/lightapp/store/b/c;


# direct methods
.method public constructor <init>(Ljava/lang/String;Lcom/waiqin365/lightapp/store/c/a;Ljava/lang/String;Ljava/lang/String;)V
    .locals 10

    const/16 v0, 0x3f0

    invoke-direct {p0, v0}, Lcom/waiqin365/lightapp/store/b/c;-><init>(I)V

    const-string/jumbo v0, "/app/store/client/v1/saveStore.action"

    iput-object v0, p0, Lcom/waiqin365/lightapp/store/b/a/d;->c:Ljava/lang/String;

    iget-object v0, p0, Lcom/waiqin365/lightapp/store/b/a/d;->e:Ljava/util/HashMap;

    const-string/jumbo v1, "Content-Type"

    const-string/jumbo v2, "application/x-www-form-urlencoded"

    invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    :try_start_0
    iget-object v0, p0, Lcom/waiqin365/lightapp/store/b/a/d;->e:Ljava/util/HashMap;

    const-string/jumbo v1, "auth-code"

    invoke-virtual {v0, v1, p1}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1

    :goto_0
    iget-object v0, p0, Lcom/waiqin365/lightapp/store/b/a/d;->d:Ljava/util/HashMap;

    const-string/jumbo v1, "data.cm_id"

    iget-object v2, p2, Lcom/waiqin365/lightapp/store/c/a;->h:Ljava/lang/String;

    invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    iget-object v0, p0, Lcom/waiqin365/lightapp/store/b/a/d;->d:Ljava/util/HashMap;

    const-string/jumbo v1, "data.visit_implement_id"

    iget-object v2, p2, Lcom/waiqin365/lightapp/store/c/a;->b:Ljava/lang/String;

    invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    iget-object v0, p0, Lcom/waiqin365/lightapp/store/b/a/d;->d:Ljava/util/HashMap;

    const-string/jumbo v1, "data.location_c"

    iget-object v2, p2, Lcom/waiqin365/lightapp/store/c/a;->k:Ljava/lang/String;

    invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    iget-object v0, p0, Lcom/waiqin365/lightapp/store/b/a/d;->d:Ljava/util/HashMap;

    const-string/jumbo v1, "data.location_a"

    iget-object v2, p2, Lcom/waiqin365/lightapp/store/c/a;->l:Ljava/lang/String;

    invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    iget-object v0, p0, Lcom/waiqin365/lightapp/store/b/a/d;->d:Ljava/util/HashMap;

    const-string/jumbo v1, "data.location_type"

    invoke-virtual {v0, v1, p3}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    iget-object v0, p0, Lcom/waiqin365/lightapp/store/b/a/d;->d:Ljava/util/HashMap;

    const-string/jumbo v1, "data.pictures"

    iget-object v2, p2, Lcom/waiqin365/lightapp/store/c/a;->m:Ljava/lang/String;

    invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    iget-object v0, p0, Lcom/waiqin365/lightapp/store/b/a/d;->d:Ljava/util/HashMap;

    const-string/jumbo v1, "data.remarks"

    iget-object v2, p2, Lcom/waiqin365/lightapp/store/c/a;->q:Ljava/lang/String;

    invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    new-instance v3, Lorg/json/JSONArray;

    invoke-direct {v3}, Lorg/json/JSONArray;-><init>()V

    const/4 v0, 0x0

    move v1, v0

    :goto_1
    iget-object v0, p2, Lcom/waiqin365/lightapp/store/c/a;->r:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    if-ge v1, v0, :cond_3

    new-instance v4, Lorg/json/JSONObject;

    invoke-direct {v4}, Lorg/json/JSONObject;-><init>()V

    iget-object v0, p2, Lcom/waiqin365/lightapp/store/c/a;->r:Ljava/util/List;

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/waiqin365/base/db/jxccache/g;

    invoke-static {}, Lcom/fiberhome/gaea/client/base/ExmobiApp;->b()Lcom/fiberhome/gaea/client/base/ExmobiApp;

    move-result-object v2

    invoke-static {v2}, Lcom/waiqin365/base/db/offlinedata/w;->a(Landroid/content/Context;)Lcom/waiqin365/base/db/offlinedata/w;

    move-result-object v2

    invoke-virtual {v0}, Lcom/waiqin365/base/db/jxccache/g;->h()Ljava/lang/String;

    move-result-object v5

    const-string/jumbo v6, "default"

    const-string/jumbo v7, ""

    invoke-virtual {v5, v6, v7}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v2, v5}, Lcom/waiqin365/base/db/offlinedata/w;->e(Ljava/lang/String;)Lcom/waiqin365/base/db/offlinedata/s;

    move-result-object v5

    :try_start_1
    const-string/jumbo v2, "id"

    invoke-virtual {v0}, Lcom/waiqin365/base/db/jxccache/g;->b()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v4, v2, v6}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    const-string/jumbo v2, "qty"

    invoke-virtual {v0}, Lcom/waiqin365/base/db/jxccache/g;->g()Ljava/lang/Double;

    move-result-object v6

    const-wide/16 v8, 0x0

    invoke-static {v6, v8, v9}, Lcom/fiberhome/gaea/client/d/k;->a(Ljava/lang/Double;D)D

    move-result-wide v6

    invoke-virtual {v4, v2, v6, v7}, Lorg/json/JSONObject;->put(Ljava/lang/String;D)Lorg/json/JSONObject;

    const-string/jumbo v2, "price"

    invoke-virtual {v0}, Lcom/waiqin365/base/db/jxccache/g;->f()Ljava/lang/Double;

    move-result-object v6

    const-wide/16 v8, 0x0

    invoke-static {v6, v8, v9}, Lcom/fiberhome/gaea/client/d/k;->a(Ljava/lang/Double;D)D

    move-result-wide v6

    invoke-virtual {v4, v2, v6, v7}, Lorg/json/JSONObject;->put(Ljava/lang/String;D)Lorg/json/JSONObject;

    const-string/jumbo v2, "m_remarks"

    invoke-virtual {v0}, Lcom/waiqin365/base/db/jxccache/g;->e()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v4, v2, v6}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    const-string/jumbo v6, "input_unit"

    invoke-virtual {v0}, Lcom/waiqin365/base/db/jxccache/g;->h()Ljava/lang/String;

    move-result-object v2

    if-nez v2, :cond_0

    const-string/jumbo v2, ""

    :goto_2
    invoke-virtual {v4, v6, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    const-string/jumbo v6, "base_unit"

    if-nez v5, :cond_1

    const-string/jumbo v2, ""

    :goto_3
    invoke-virtual {v4, v6, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    const-string/jumbo v2, "base_unit_qty"

    invoke-virtual {v0}, Lcom/waiqin365/base/db/jxccache/g;->g()Ljava/lang/Double;

    move-result-object v0

    const-wide/16 v6, 0x0

    invoke-static {v0, v6, v7}, Lcom/fiberhome/gaea/client/d/k;->a(Ljava/lang/Double;D)D

    move-result-wide v6

    if-nez v5, :cond_2

    const/4 v0, 0x0

    :goto_4
    const-wide/high16 v8, 0x3ff0000000000000L    # 1.0

    invoke-static {v0, v8, v9}, Lcom/fiberhome/gaea/client/d/k;->a(Ljava/lang/Double;D)D

    move-result-wide v8

    mul-double/2addr v6, v8

    invoke-virtual {v4, v2, v6, v7}, Lorg/json/JSONObject;->put(Ljava/lang/String;D)Lorg/json/JSONObject;
    :try_end_1
    .catch Lorg/json/JSONException; {:try_start_1 .. :try_end_1} :catch_0

    :goto_5
    invoke-virtual {v3, v4}, Lorg/json/JSONArray;->put(Ljava/lang/Object;)Lorg/json/JSONArray;

    add-int/lit8 v0, v1, 0x1

    move v1, v0

    goto/16 :goto_1

    :cond_0
    :try_start_2
    invoke-virtual {v0}, Lcom/waiqin365/base/db/jxccache/g;->h()Ljava/lang/String;

    move-result-object v2

    const-string/jumbo v7, "default"

    const-string/jumbo v8, ""

    invoke-virtual {v2, v7, v8}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;

    move-result-object v2

    goto :goto_2

    :cond_1
    invoke-virtual {v5}, Lcom/waiqin365/base/db/offlinedata/s;->a()Ljava/lang/String;

    move-result-object v2

    const-string/jumbo v7, "default"

    const-string/jumbo v8, ""

    invoke-virtual {v2, v7, v8}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;

    move-result-object v2

    goto :goto_3

    :cond_2
    invoke-virtual {v5}, Lcom/waiqin365/base/db/offlinedata/s;->e()Ljava/lang/Double;
    :try_end_2
    .catch Lorg/json/JSONException; {:try_start_2 .. :try_end_2} :catch_0

    move-result-object v0

    goto :goto_4

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Lorg/json/JSONException;->printStackTrace()V

    goto :goto_5

    :cond_3
    iget-object v0, p0, Lcom/waiqin365/lightapp/store/b/a/d;->d:Ljava/util/HashMap;

    const-string/jumbo v1, "data.products"

    invoke-virtual {v3}, Lorg/json/JSONArray;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    iget-object v0, p0, Lcom/waiqin365/lightapp/store/b/a/d;->d:Ljava/util/HashMap;

    const-string/jumbo v1, "data.token"

    invoke-virtual {v0, v1, p4}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    return-void

    :catch_1
    move-exception v0

    goto/16 :goto_0
.end method
